﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPageAdmin.master" AutoEventWireup="true" CodeFile="Add_category.aspx.cs" Inherits="Admin_Add_category" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style8
        {
            text-align: center;
        }
        .style11
        {
            width: 333px;
            text-align: right;
        }
        .style12
        {
            font-weight: bold;
            color: #66CCFF;
        }
        .style9
        {
            width: 22px;
        }
        .style10
        {
            width: 333px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table class="style7">
        <tr>
            <td class="style8" colspan="3">
                <asp:Label ID="Label2" runat="server" 
                    style="font-weight: 700; font-size: xx-large; color: #CC9900" 
                    Text="Add Category"></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style11">
                <asp:Label ID="Label4" runat="server" CssClass="style12" Text="Category name"></asp:Label>
            </td>
            <td class="style9">
                &nbsp;</td>
            <td>
                <asp:TextBox ID="txtCategoryname" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="style11">
                &nbsp;</td>
            <td class="style9">
                &nbsp;</td>
            <td>
                &nbsp;</td>
        </tr>
        <tr>
            <td class="style10">
                <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                    DeleteCommand="DELETE FROM [tblEbookCategory] WHERE [categoryId] = @categoryId" 
                    InsertCommand="INSERT INTO [tblEbookCategory] ([categoryName]) VALUES (@categoryName)" 
                    SelectCommand="SELECT * FROM [tblEbookCategory]" 
                    UpdateCommand="UPDATE [tblEbookCategory] SET [categoryName] = @categoryName WHERE [categoryId] = @categoryId">
                    <DeleteParameters>
                        <asp:Parameter Name="categoryId" Type="Int32" />
                    </DeleteParameters>
                    <UpdateParameters>
                        <asp:Parameter Name="categoryName" Type="String" />
                        <asp:Parameter Name="categoryId" Type="Int32" />
                    </UpdateParameters>
                    <InsertParameters>
                        <asp:ControlParameter ControlID="txtCategoryname" Name="categoryName" 
                            PropertyName="Text" Type="String" />
                    </InsertParameters>
                </asp:SqlDataSource>
                <asp:Label ID="lblMsg" runat="server" style="color: #FF0000; font-size: medium"></asp:Label>
            </td>
            <td class="style9">
                &nbsp;</td>
            <td>
                <asp:Button ID="bntAdd" runat="server" onclick="bntAdd_Click" Text="Add" />
            </td>
        </tr>
    </table>
</asp:Content>

